<?php

include_once("./SweetSuite/SweetTestRunner.php");
include_once("./SweetSuite/Generators/SweetXMLGenerator.php");
include_once("./SweetSuite/Generators/SweetHTMLGenerator.php");

$sweetTestRunner = new SweetTestRunner();

if(isset($_GET['path']))
{
	$sweetTestRunner->addPath($_GET['path']);
} else if(isset($_GET['class']))
{	
	$sweetTestRunner->addClass($_GET['class']);
}

$sweetTestRunner->run(true);

if(isset($_GET['xml']))
{
	$sweetXMLGenerator = new SweetXMLGenerator($sweetTestRunner->getSuite());
	$sweetXMLGenerator->createFile($_GET['xml']);
}

if(isset($_GET['html']) && $_GET['html'] == "true")
{
	echo "<html><link href='SweetSuite/Style/Sweet.css' rel='stylesheet' type='text/css'><body>";
	$sweetHTMLGenerator = new SweetHTMLGenerator($sweetTestRunner->getSuite());
	echo $sweetHTMLGenerator->generate();
	echo "</body></html>";
}


?>